package com.javatest.app;

import java.time.Instant;
import java.util.concurrent.TimeUnit;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2020-05-30 22:18
 */
public class ThreadTest {
    public static void main(String[] args) throws InterruptedException {
        System.out.println("start program");
        new Thread(() -> {
            while (true) {
                System.out.println(Instant.now());
                try {
                    TimeUnit.SECONDS.sleep(2);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }
}
